package com.xxgc.eow.error;

import cn.dev33.satoken.exception.NotLoginException;
import com.xxgc.eow.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @program: vue3
 * @description: 全局异常
 * @author: Mr.Abel
 * @create: 2023-04-03 10:50
 **/
@Slf4j
@ControllerAdvice
@ResponseBody
public class ApplicationException {
    /**
     * 用户token过期
     * @param e
     * @return
     */
    @ExceptionHandler(value = {NotLoginException.class})
    public Result quartzTimeException(NotLoginException e) {
        return Result.error(401,"请先登录",e.getMessage());
    }
}